package com.weibo4j.api.req.favourite;

import java.util.Arrays;
import java.util.List;

import com.weibo4j.api.WeiboRequest;
import com.weibo4j.api.response.favourite.FavouritesBatchDeleteResponse;
import com.weibo4j.api.util.RequestType;

public class FavouriteBatchDeleteRequest extends WeiboRequest<FavouritesBatchDeleteResponse>{

    private List<String> idList;

    public void setIdList(List<String> idList) {
        this.idList = idList;
    }

    public List<String> getIdList() {
        return idList;
    }
    
    public String getCids() {
        if (idList != null && !idList.isEmpty()) {
            String ids = Arrays.toString(idList.toArray(new String[idList.size()]));
            return ids.substring(1, ids.length() - 1);
        } else {
            return null;
        }
    }
    
    @Override
    public RequestType requestType() {
        return RequestType.POST;
    }

    @Override
    public String baseUrl() {
        return "https://api.weibo.com/2/favorites/destroy_batch.json";
    }

    @Override
    protected Class<FavouritesBatchDeleteResponse> responseType() {
        return FavouritesBatchDeleteResponse.class;
    }

}
